import re
with open(r'c:\tools\disp_arp.txt') as data:
	for line in data:
		print(line.strip())


line='172.29.50.150   4c1f-ccb4-5157            I -  Vlanif41'
print(line)
# match = re.search('(?P<ip>\d+\.\d+\.\d+\.\d+) +(?P<mac>\w+-\w+-\w+) +.* (?P<port>\S+)',line)
# match = re.search(r'(?P<ip>\d+\.\d+\.\d+\.\d+)+(?P<mac>\w+-\w+-\w+)+.*(?P<port>\S+)', line)
# print(match.groups())
# print(match.groupdict())
m1=re.search(r'\d+.\d+.\d+.\d+',line)
print(m1.group())
match1=re.search(r'(?P<ip>\d+.\d+.\d+.\d+)',line)
print(match1.groups())
print(match1.groupdict())

m2=re.search(r'\w+-\w+-\w+',line)
print(m2.group())
mathc2=re.search(r'(?P<mac>\w+-\w+-\w+)',line)
print(mathc2.groups())
print(mathc2.groupdict())
# line='172.29.50.150   4c1f-ccb4-5157            I -  Vlanif41'`
m3=re.search(r'V\S+',line)
print(m3.group())
match3=re.search(r'(?P<port>V\S+)',line)
print(m3.groupdict())
print(match3.groups())
print(match3.groupdict())